home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 92 / CDMM92_1.ISO / SOF 2 SDK / sof2sdk-101.msi / _92D6AC311BB48EBA344BBABC89DA6AB0 / _22B85787703A4BBC972211099B5A64D7 < prev    next >
Encoding:
Text File  |  2002-06-05  |  30.6 KB  |  1,057 lines

  1. // Copyright (C) 2001-2002 Raven Software.
  2. //
  3. // cg_syscalls.c -- this file is only included when building a dll
  4. // cg_syscalls.asm is included instead when building a qvm
  5. #include "cg_local.h"
  6.  
  7. static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1;
  8.  
  9.  
  10. void dllEntry( int (QDECL  *syscallptr)( int arg,... ) ) {
  11.     syscall = syscallptr;
  12. }
  13.  
  14.  
  15. int PASSFLOAT( float x ) {
  16.     float    floatTemp;
  17.     floatTemp = x;
  18.     return *(int *)&floatTemp;
  19. }
  20.  
  21. void    trap_Print( const char *fmt ) {
  22.     syscall( CG_PRINT, fmt );
  23. }
  24.  
  25. void    trap_Error( const char *fmt ) {
  26.     syscall( CG_ERROR, fmt );
  27. }
  28.  
  29. int        trap_Milliseconds( void ) {
  30.     return syscall( CG_MILLISECONDS ); 
  31. }
  32.  
  33. void    trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags, float MinValue, float MaxValue ) 
  34. {
  35.     syscall( CG_CVAR_REGISTER, vmCvar, varName, defaultValue, flags, PASSFLOAT(MinValue), PASSFLOAT(MaxValue) );
  36. }
  37.  
  38. void    trap_Cvar_Update( vmCvar_t *vmCvar ) {
  39.     syscall( CG_CVAR_UPDATE, vmCvar );
  40. }
  41.  
  42. void    trap_Cvar_Set( const char *var_name, const char *value ) {
  43.     syscall( CG_CVAR_SET, var_name, value );
  44. }
  45.  
  46. void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) {
  47.     syscall( CG_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
  48. }
  49.  
  50. int        trap_Argc( void ) {
  51.     return syscall( CG_ARGC );
  52. }
  53.  
  54. void    trap_Argv( int n, char *buffer, int bufferLength ) {
  55.     syscall( CG_ARGV, n, buffer, bufferLength );
  56. }
  57.  
  58. void    trap_Args( char *buffer, int bufferLength ) {
  59.     syscall( CG_ARGS, buffer, bufferLength );
  60. }
  61.  
  62. int        trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
  63.     return syscall( CG_FS_FOPENFILE, qpath, f, mode );
  64. }
  65.  
  66. void    trap_FS_Read( void *buffer, int len, fileHandle_t f ) {
  67.     syscall( CG_FS_READ, buffer, len, f );
  68. }
  69.  
  70. void    trap_FS_Write( const void *buffer, int len, fileHandle_t f ) {
  71.     syscall( CG_FS_WRITE, buffer, len, f );
  72. }
  73.  
  74. void    trap_FS_FCloseFile( fileHandle_t f ) {
  75.     syscall( CG_FS_FCLOSEFILE, f );
  76. }
  77.  
  78. void    trap_SendConsoleCommand( const char *text ) {
  79.     syscall( CG_SENDCONSOLECOMMAND, text );
  80. }
  81.  
  82. void    trap_AddCommand( const char *cmdName ) {
  83.     syscall( CG_ADDCOMMAND, cmdName );
  84. }
  85.  
  86. void    trap_RemoveCommand( const char *cmdName ) {
  87.     syscall( CG_REMOVECOMMAND, cmdName );
  88. }
  89.  
  90. void    trap_SendClientCommand( const char *s ) {
  91.     syscall( CG_SENDCLIENTCOMMAND, s );
  92. }
  93.  
  94. void    trap_UpdateScreen( void ) {
  95.     syscall( CG_UPDATESCREEN );
  96. }
  97.  
  98. void trap_RMG_Init(int terrainID, const char *terrainInfo)
  99. {
  100.     syscall(CG_RMG_INIT, terrainID, terrainInfo);
  101. }
  102.  
  103. void    trap_CM_LoadMap( const char *mapname, qboolean SubBSP ) {
  104.     syscall( CG_CM_LOADMAP, mapname, SubBSP );
  105. }
  106.  
  107. int        trap_CM_NumInlineModels( void ) {
  108.     return syscall( CG_CM_NUMINLINEMODELS );
  109. }
  110.  
  111. clipHandle_t trap_CM_InlineModel( int index ) {
  112.     return syscall( CG_CM_INLINEMODEL, index );
  113. }
  114.  
  115. clipHandle_t trap_CM_TempBoxModel( const vec3_t mins, const vec3_t maxs ) {
  116.     return syscall( CG_CM_TEMPBOXMODEL, mins, maxs );
  117. }
  118.  
  119. clipHandle_t trap_CM_TempCapsuleModel( const vec3_t mins, const vec3_t maxs ) {
  120.     return syscall( CG_CM_TEMPCAPSULEMODEL, mins, maxs );
  121. }
  122.  
  123. int        trap_CM_PointContents( const vec3_t p, clipHandle_t model ) {
  124.     return syscall( CG_CM_POINTCONTENTS, p, model );
  125. }
  126.  
  127. int        trap_CM_TransformedPointContents( const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles ) {
  128.     return syscall( CG_CM_TRANSFORMEDPOINTCONTENTS, p, model, origin, angles );
  129. }
  130.  
  131. void    trap_CM_BoxTrace( trace_t *results, const vec3_t start, const vec3_t end,
  132.                           const vec3_t mins, const vec3_t maxs,
  133.                           clipHandle_t model, int brushmask ) {
  134.     syscall( CG_CM_BOXTRACE, results, start, end, mins, maxs, model, brushmask );
  135. }
  136.  
  137. void    trap_CM_CapsuleTrace( trace_t *results, const vec3_t start, const vec3_t end,
  138.                           const vec3_t mins, const vec3_t maxs,
  139.                           clipHandle_t model, int brushmask ) {
  140.     syscall( CG_CM_CAPSULETRACE, results, start, end, mins, maxs, model, brushmask );
  141. }
  142.  
  143. void    trap_CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const vec3_t end,
  144.                           const vec3_t mins, const vec3_t maxs,
  145.                           clipHandle_t model, int brushmask,
  146.                           const vec3_t origin, const vec3_t angles ) {
  147.     syscall( CG_CM_TRANSFORMEDBOXTRACE, results, start, end, mins, maxs, model, brushmask, origin, angles );
  148. }
  149.  
  150. void    trap_CM_TransformedCapsuleTrace( trace_t *results, const vec3_t start, const vec3_t end,
  151.                           const vec3_t mins, const vec3_t maxs,
  152.                           clipHandle_t model, int brushmask,
  153.                           const vec3_t origin, const vec3_t angles ) {
  154.     syscall( CG_CM_TRANSFORMEDCAPSULETRACE, results, start, end, mins, maxs, model, brushmask, origin, angles );
  155. }
  156.  
  157. int        trap_CM_MarkFragments( int numPoints, const vec3_t *points, 
  158.                 const vec3_t projection,
  159.                 int maxPoints, vec3_t pointBuffer,
  160.                 int maxFragments, markFragment_t *fragmentBuffer ) {
  161.     return syscall( CG_CM_MARKFRAGMENTS, numPoints, points, projection, maxPoints, pointBuffer, maxFragments, fragmentBuffer );
  162. }
  163.  
  164. void trap_S_StopAllSounds ( void )
  165. {
  166.     syscall( CG_S_STOPALLSOUNDS );
  167. }
  168.  
  169. void    trap_S_StartSound( vec3_t origin, int entityNum, int entchannel, sfxHandle_t sfx, int volume, int radius ) 
  170. {
  171.     syscall( CG_S_STARTSOUND, origin, entityNum, entchannel, sfx, volume, radius );
  172. }
  173.  
  174. void    trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ) {
  175.     syscall( CG_S_STARTLOCALSOUND, sfx, channelNum );
  176. }
  177.  
  178. void    trap_S_ClearLoopingSounds( qboolean killall ) {
  179.     syscall( CG_S_CLEARLOOPINGSOUNDS, killall );
  180. }
  181.  
  182. void    trap_S_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, float radius, sfxHandle_t sfx ) 
  183. {
  184.     syscall( CG_S_ADDLOOPINGSOUND, entityNum, origin, velocity, PASSFLOAT(radius), sfx );
  185. }
  186.  
  187. void    trap_S_AddRealLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, float radius, sfxHandle_t sfx ) 
  188. {
  189.     syscall( CG_S_ADDREALLOOPINGSOUND, entityNum, origin, velocity, PASSFLOAT(radius), sfx );
  190. }
  191.  
  192. void    trap_S_StopLoopingSound( int entityNum ) {
  193.     syscall( CG_S_STOPLOOPINGSOUND, entityNum );
  194. }
  195.  
  196. void    trap_S_UpdateEntityPosition( int entityNum, const vec3_t origin ) {
  197.     syscall( CG_S_UPDATEENTITYPOSITION, entityNum, origin );
  198. }
  199.  
  200. void    trap_S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater ) {
  201.     syscall( CG_S_RESPATIALIZE, entityNum, origin, axis, inwater );
  202. }
  203.  
  204. sfxHandle_t    trap_S_RegisterSound( const char *sample ) {
  205.     return syscall( CG_S_REGISTERSOUND, sample );
  206. }
  207.  
  208. void    trap_S_StartBackgroundTrack( const char *intro, const char *loop, qboolean bReturnWithoutStarting  ) {
  209.     syscall( CG_S_STARTBACKGROUNDTRACK, intro, loop, bReturnWithoutStarting  );
  210. }
  211.  
  212. void    trap_AS_AddPrecacheEntry(const char *set)
  213. {
  214.     syscall( CG_AS_ADDPRECACHEENTRY, set );
  215. }
  216.  
  217. void    trap_AS_ParseSets(void)
  218. {
  219.     syscall( CG_AS_PARSESETS );
  220. }
  221.  
  222. void trap_AS_UpdateAmbientSet (const char *name, vec3_t origin)
  223. {
  224.     syscall( CG_AS_UPDATEAMBIENTSET, name, origin );
  225. }
  226.  
  227. int    trap_AS_AddLocalSet(const char *name, vec3_t listener_origin, vec3_t origin, int entID, int time)
  228. {
  229.     return syscall( CG_AS_ADDLOCALSET, name, listener_origin, origin, entID, time );
  230. }
  231.  
  232. sfxHandle_t    trap_AS_GetBModelSound(const char *name, int stage)
  233. {
  234.     return (sfxHandle_t)syscall( CG_AS_GETBMODELSOUND, name, stage );
  235. }
  236.  
  237. void    trap_R_LoadWorldMap( const char *mapname ) {
  238.     syscall( CG_R_LOADWORLDMAP, mapname );
  239. }
  240.  
  241. qhandle_t trap_R_RegisterModel( const char *name ) {
  242.     return syscall( CG_R_REGISTERMODEL, name );
  243. }
  244.  
  245. qhandle_t trap_R_RegisterSkin( const char *name ) {
  246.     return syscall( CG_R_REGISTERSKIN, name );
  247. }
  248.  
  249. qhandle_t trap_R_RegisterShader( const char *name ) {
  250.     return syscall( CG_R_REGISTERSHADER, name );
  251. }
  252.  
  253. qhandle_t trap_R_RegisterShaderNoMip( const char *name ) {
  254.     return syscall( CG_R_REGISTERSHADERNOMIP, name );
  255. }
  256.  
  257. qhandle_t trap_R_RegisterFont(const char *fontName) 
  258. {
  259.     return (qhandle_t)syscall(CG_R_REGISTERFONT, fontName );
  260. }
  261.  
  262. void    trap_R_ClearScene( void ) {
  263.     syscall( CG_R_CLEARSCENE );
  264. }
  265.  
  266. void trap_R_ClearDecals ( void )
  267. {
  268.     syscall ( CG_R_CLEARDECALS );
  269. }
  270.  
  271. void    trap_R_AddRefEntityToScene( const refEntity_t *re ) {
  272.     syscall( CG_R_ADDREFENTITYTOSCENE, re );
  273. }
  274.  
  275. void    trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ) {
  276.     syscall( CG_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
  277. }
  278.  
  279. void trap_R_AddDecalToScene ( qhandle_t shader, const vec3_t origin, const vec3_t dir, float orientation, float r, float g, float b, float a, qboolean alphaFade, float radius, qboolean temporary )
  280. {
  281.     syscall( CG_R_ADDDECALTOSCENE, shader, origin, dir, PASSFLOAT(orientation), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b), PASSFLOAT(a), alphaFade, PASSFLOAT(radius), temporary );
  282. }
  283.  
  284. void    trap_R_AddPolysToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts, int num ) {
  285.     syscall( CG_R_ADDPOLYSTOSCENE, hShader, numVerts, verts, num );
  286. }
  287.  
  288. int        trap_R_LightForPoint( vec3_t point, vec3_t ambientLight, vec3_t directedLight, vec3_t lightDir ) {
  289.     return syscall( CG_R_LIGHTFORPOINT, point, ambientLight, directedLight, lightDir );
  290. }
  291.  
  292. void    trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
  293.     syscall( CG_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
  294. }
  295.  
  296. void    trap_R_AddAdditiveLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
  297.     syscall( CG_R_ADDADDITIVELIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
  298. }
  299.  
  300. void    trap_R_RenderScene( const refdef_t *fd ) {
  301.     syscall( CG_R_RENDERSCENE, fd );
  302. }
  303.  
  304. void trap_R_DrawVisualOverlay    ( visual_t type, qboolean preProcess, float parm1, float parm2 )
  305. {
  306.     syscall( CG_R_DRAWVISUALOVERLAY, type, preProcess, PASSFLOAT(parm1), PASSFLOAT(parm2) );
  307. }
  308.  
  309. void    trap_R_SetColor( const float *rgba ) {
  310.     syscall( CG_R_SETCOLOR, rgba );
  311. }
  312.  
  313. void    trap_R_DrawStretchPic( float x, float y, float w, float h, 
  314.                                float s1, float t1, float s2, float t2, const float* color, qhandle_t hShader ) {
  315.     syscall( CG_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), color, hShader );
  316. }
  317.  
  318. void    trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ) {
  319.     syscall( CG_R_MODELBOUNDS, model, mins, maxs );
  320. }
  321.  
  322. int        trap_R_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, 
  323.                        float frac, const char *tagName ) {
  324.     return syscall( CG_R_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
  325. }
  326.  
  327. void    trap_R_DrawRotatePic( float x, float y, float w, float h, 
  328.                    float s1, float t1, float s2, float t2,float a, qhandle_t hShader ) 
  329. {
  330.     syscall( CG_R_DRAWROTATEPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), PASSFLOAT(a), hShader );
  331. }
  332.  
  333. void    trap_R_DrawRotatePic2( float x, float y, float w, float h, 
  334.                    float s1, float t1, float s2, float t2,float a, qhandle_t hShader ) 
  335. {
  336.     syscall( CG_R_DRAWROTATEPIC2, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), PASSFLOAT(a), hShader );
  337. }
  338.  
  339. void    trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) 
  340. {
  341.     syscall( CG_R_REMAP_SHADER, oldShader, newShader, timeOffset );
  342. }
  343.  
  344. void    trap_R_GetLightStyle(int style, color4ub_t color)
  345. {
  346.     syscall( CG_R_GET_LIGHT_STYLE, style, color );
  347. }
  348.  
  349. void    trap_R_SetLightStyle(int style, int color)
  350. {
  351.     syscall( CG_R_SET_LIGHT_STYLE, style, color );
  352. }
  353.  
  354. int        trap_R_GetTextWidth  ( const char* text, qhandle_t font, float scale, int limit )
  355. {
  356.     return syscall ( CG_R_GETTEXTWIDTH, text, font, PASSFLOAT(scale), limit );
  357. }
  358.     
  359. int        trap_R_GetTextHeight ( const char* text, qhandle_t font, float scale, int limit )
  360. {
  361.     return syscall ( CG_R_GETTEXTHEIGHT, text, font, PASSFLOAT(scale), limit );
  362. }
  363.  
  364. void    trap_R_DrawText ( int x, int y, qhandle_t font, float scale, vec4_t color, const char* text, int limit, int flags )
  365. {
  366.     syscall ( CG_R_DRAWTEXT, x, y, font, PASSFLOAT(scale), color, text, limit, flags );
  367. }
  368.  
  369. void trap_R_DrawTextWithCursor ( int x, int y, qhandle_t font, float scale, vec4_t color, const char* text, int limit, int flags, int cursorPos, char cursor )
  370. {
  371.     syscall ( CG_R_DRAWTEXTWITHCURSOR, x, y, font, PASSFLOAT(scale), color, text, limit, flags, cursorPos, cursor );
  372. }
  373.  
  374. void    trap_FX_AddLine( const vec3_t start, const vec3_t end, float size1, float size2, float sizeParm,
  375.                                     float alpha1, float alpha2, float alphaParm,
  376.                                     const vec3_t sRGB, const vec3_t eRGB, float rgbParm,
  377.                                     int killTime, qhandle_t shader, int flags)
  378. {
  379.     syscall( CG_FX_ADDLINE, start, end, PASSFLOAT(size1), PASSFLOAT(size2), PASSFLOAT(sizeParm),
  380.                                     PASSFLOAT(alpha1), PASSFLOAT(alpha2), PASSFLOAT(alphaParm),
  381.                                     sRGB, eRGB, PASSFLOAT(rgbParm),
  382.                                     killTime, shader, flags);
  383. }
  384.  
  385. void        trap_GetGlconfig( glconfig_t *glconfig ) {
  386.     syscall( CG_GETGLCONFIG, glconfig );
  387. }
  388.  
  389. void        trap_GetGameState( gameState_t *gamestate ) {
  390.     syscall( CG_GETGAMESTATE, gamestate );
  391. }
  392.  
  393. void        trap_GetCurrentSnapshotNumber( int *snapshotNumber, int *serverTime ) {
  394.     syscall( CG_GETCURRENTSNAPSHOTNUMBER, snapshotNumber, serverTime );
  395. }
  396.  
  397. qboolean    trap_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
  398.     return syscall( CG_GETSNAPSHOT, snapshotNumber, snapshot );
  399. }
  400.  
  401. qboolean    trap_GetDefaultState(int entityIndex, entityState_t *state )
  402. {
  403.     return syscall( CG_GETDEFAULTSTATE, entityIndex, state );
  404. }
  405.  
  406. qboolean    trap_GetServerCommand( int serverCommandNumber ) {
  407.     return syscall( CG_GETSERVERCOMMAND, serverCommandNumber );
  408. }
  409.  
  410. int            trap_GetCurrentCmdNumber( void ) {
  411.     return syscall( CG_GETCURRENTCMDNUMBER );
  412. }
  413.  
  414. qboolean    trap_GetUserCmd( int cmdNumber, usercmd_t *ucmd ) {
  415.     return syscall( CG_GETUSERCMD, cmdNumber, ucmd );
  416. }
  417.  
  418. void trap_SetUserCmdValue( int stateValue, float sensitivityScale ) {
  419.     syscall( CG_SETUSERCMDVALUE, stateValue, PASSFLOAT(sensitivityScale) );
  420. }
  421.  
  422. void trap_RW_SetTeam(int team, qboolean dead )
  423. {
  424.     syscall( CG_RW_SETTEAM, team, dead );
  425. }
  426.  
  427. void trap_ResetAutorun ( void )
  428. {
  429.     syscall ( CG_RESETAUTORUN );
  430. }
  431.  
  432. void        testPrintInt( char *string, int i ) {
  433.     syscall( CG_TESTPRINTINT, string, i );
  434. }
  435.  
  436. void        testPrintFloat( char *string, float f ) {
  437.     syscall( CG_TESTPRINTFLOAT, string, PASSFLOAT(f) );
  438. }
  439.  
  440. int trap_MemoryRemaining( void ) {
  441.     return syscall( CG_MEMORY_REMAINING );
  442. }
  443.  
  444. qboolean trap_Key_IsDown( int keynum ) {
  445.     return syscall( CG_KEY_ISDOWN, keynum );
  446. }
  447.  
  448. int trap_Key_GetCatcher( void ) {
  449.     return syscall( CG_KEY_GETCATCHER );
  450. }
  451.  
  452. void trap_Key_SetCatcher( int catcher ) {
  453.     syscall( CG_KEY_SETCATCHER, catcher );
  454. }
  455.  
  456. int trap_Key_GetKey( const char *binding ) {
  457.     return syscall( CG_KEY_GETKEY, binding );
  458. }
  459.  
  460. int trap_PC_AddGlobalDefine( char *define ) {
  461.     return syscall( CG_PC_ADD_GLOBAL_DEFINE, define );
  462. }
  463.  
  464. int trap_PC_LoadSource( const char *filename ) {
  465.     return syscall( CG_PC_LOAD_SOURCE, filename );
  466. }
  467.  
  468. int trap_PC_FreeSource( int handle ) {
  469.     return syscall( CG_PC_FREE_SOURCE, handle );
  470. }
  471.  
  472. int trap_PC_ReadToken( int handle, pc_token_t *pc_token ) {
  473.     return syscall( CG_PC_READ_TOKEN, handle, pc_token );
  474. }
  475.  
  476. int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ) {
  477.     return syscall( CG_PC_SOURCE_FILE_AND_LINE, handle, filename, line );
  478. }
  479.  
  480. int trap_PC_LoadGlobalDefines ( const char* filename )
  481. {
  482.     return syscall ( CG_PC_LOAD_GLOBAL_DEFINES, filename );
  483. }
  484.  
  485. void trap_PC_RemoveAllGlobalDefines ( void )
  486. {
  487.     syscall ( CG_PC_REMOVE_ALL_GLOBAL_DEFINES );
  488. }
  489.  
  490. void    trap_S_StopBackgroundTrack( void ) {
  491.     syscall( CG_S_STOPBACKGROUNDTRACK );
  492. }
  493.  
  494. int trap_RealTime(qtime_t *qtime) {
  495.     return syscall( CG_REAL_TIME, qtime );
  496. }
  497.  
  498. void trap_SnapVector( float *v ) {
  499.     syscall( CG_SNAPVECTOR, v );
  500. }
  501.  
  502. // this returns a handle.  arg0 is the name in the format "idlogo.roq", set arg1 to NULL, alteredstates to qfalse (do not alter gamestate)
  503. int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits) {
  504.   return syscall(CG_CIN_PLAYCINEMATIC, arg0, xpos, ypos, width, height, bits);
  505. }
  506.  
  507. // stops playing the cinematic and ends it.  should always return FMV_EOF
  508. // cinematics must be stopped in reverse order of when they are started
  509. e_status trap_CIN_StopCinematic(int handle) {
  510.   return syscall(CG_CIN_STOPCINEMATIC, handle);
  511. }
  512.  
  513.  
  514. // will run a frame of the cinematic but will not draw it.  Will return FMV_EOF if the end of the cinematic has been reached.
  515. e_status trap_CIN_RunCinematic (int handle) {
  516.   return syscall(CG_CIN_RUNCINEMATIC, handle);
  517. }
  518.  
  519.  
  520. // draws the current frame
  521. void trap_CIN_DrawCinematic (int handle) {
  522.   syscall(CG_CIN_DRAWCINEMATIC, handle);
  523. }
  524.  
  525.  
  526. // allows you to resize the animation dynamically
  527. void trap_CIN_SetExtents (int handle, int x, int y, int w, int h) {
  528.   syscall(CG_CIN_SETEXTENTS, handle, x, y, w, h);
  529. }
  530.  
  531. qboolean trap_GetEntityToken( char *buffer, int bufferSize ) {
  532.     return syscall( CG_GET_ENTITY_TOKEN, buffer, bufferSize );
  533. }
  534.  
  535. qboolean trap_R_inPVS( const vec3_t p1, const vec3_t p2 ) {
  536.     return syscall( CG_R_INPVS, p1, p2 );
  537. }
  538.  
  539. int    trap_FX_RegisterEffect(const char *file)
  540. {
  541.     return syscall( CG_FX_REGISTER_EFFECT, file);
  542. }
  543.  
  544. void trap_FX_PlaySimpleEffect( const char *file, vec3_t org, int vol, int rad )
  545. {
  546.     syscall( CG_FX_PLAY_SIMPLE_EFFECT, file, org, vol, rad );
  547. }
  548.  
  549. void trap_FX_PlayEffect( const char *file, vec3_t org, vec3_t fwd, int vol, int rad )
  550. {
  551.     syscall( CG_FX_PLAY_EFFECT, file, org, fwd, vol, rad);
  552. }
  553.  
  554. void trap_FX_PlayEntityEffect( const char *file, vec3_t org, 
  555.                         vec3_t axis[3], const int boltInfo, const int entNum, int vol, int rad )
  556. {
  557.     syscall( CG_FX_PLAY_ENTITY_EFFECT, file, org, axis, boltInfo, entNum, vol, rad );
  558. }
  559.  
  560. void trap_FX_PlaySimpleEffectID( int id, vec3_t org, int vol, int rad )
  561. {
  562.     syscall( CG_FX_PLAY_SIMPLE_EFFECT_ID, id, org, vol, rad );
  563. }
  564.  
  565. void trap_FX_PlayEffectID( int id, vec3_t org, vec3_t fwd, int vol, int rad )
  566. {
  567.     syscall( CG_FX_PLAY_EFFECT_ID, id, org, fwd, vol, rad );
  568. }
  569.  
  570. void trap_FX_PlayEntityEffectID( int id, vec3_t org, 
  571.                         vec3_t axis[3], const int boltInfo, const int entNum, int vol, int rad )
  572. {
  573.     syscall( CG_FX_PLAY_ENTITY_EFFECT_ID, id, org, axis, boltInfo, entNum, vol, rad );
  574. }
  575.  
  576. void trap_FX_PlayBoltedEffectID(int id,CFxBoltInterface *obj, int vol, int rad )
  577. {
  578.     syscall( CG_FX_PLAY_BOLTED_EFFECT_ID, id, obj, vol, rad);
  579. }
  580.  
  581. void trap_FX_AddScheduledEffects( void )
  582. {
  583.     syscall( CG_FX_ADD_SCHEDULED_EFFECTS );
  584. }
  585.  
  586. void trap_FX_Draw2DEffects ( float screenXScale, float screenYScale )
  587. {
  588.     syscall( CG_FX_DRAW_2D_EFFECTS, PASSFLOAT(screenXScale), PASSFLOAT(screenYScale) );
  589. }    
  590.  
  591. int    trap_FX_InitSystem( refdef_t* refdef )
  592. {
  593.     return syscall( CG_FX_INIT_SYSTEM, refdef );
  594. }
  595.  
  596. qboolean trap_FX_FreeSystem( void )
  597. {
  598.     return syscall( CG_FX_FREE_SYSTEM );
  599. }
  600.  
  601. void trap_FX_Reset ( void )
  602. {
  603.     syscall ( CG_FX_RESET );
  604. }
  605.  
  606. void trap_FX_AdjustTime( int time )
  607. {
  608.     syscall( CG_FX_ADJUST_TIME, time );
  609. }
  610.  
  611. /*
  612. Ghoul2 Insert Start
  613. */
  614. // CG Specific API calls
  615. void trap_G2_ListModelSurfaces(void *ghlInfo)
  616. {
  617.     syscall( CG_G2_LISTSURFACES, ghlInfo);
  618. }
  619.  
  620. void trap_G2_ListModelBones(void *ghlInfo, int frame)
  621. {
  622.     syscall( CG_G2_LISTBONES, ghlInfo, frame);
  623. }
  624.  
  625. void trap_G2_SetGhoul2ModelIndexes(void *ghoul2, qhandle_t *modelList, qhandle_t *skinList)
  626. {
  627.     syscall( CG_G2_SETMODELS, ghoul2, modelList, skinList);
  628. }
  629.  
  630. void trap_G2API_CollisionDetect ( 
  631.     CollisionRecord_t *collRecMap, 
  632.     void* ghoul2, 
  633.     const vec3_t angles, 
  634.     const vec3_t position,
  635.     int frameNumber, 
  636.     int entNum, 
  637.     const vec3_t rayStart, 
  638.     const vec3_t rayEnd, 
  639.     const vec3_t scale, 
  640.     int traceFlags, 
  641.     int useLod
  642.     )
  643. {
  644.     syscall ( CG_G2_COLLISIONDETECT, collRecMap, ghoul2, angles, position, frameNumber, entNum, rayStart, rayEnd, scale, traceFlags, useLod );
  645. }
  646.  
  647. int    trap_G2API_AddBolt(void *ghoul2, const int modelIndex, const char *boneName)
  648. {
  649.     return (int) (syscall(CG_G2_ADDBOLT, ghoul2, modelIndex, boneName));
  650. }
  651.  
  652. void trap_G2API_SetBoltInfo(void *ghoul2, int modelIndex, int boltInfo)
  653. {
  654.     syscall(CG_G2_SETBOLTON, ghoul2, modelIndex, boltInfo);
  655. }
  656.  
  657. qboolean trap_G2API_RemoveBolt(void *ghlInfo, const int modelIndex, const int index)
  658. {
  659.     return (qboolean)(syscall(CG_G2_REMOVEBOLT, ghlInfo, modelIndex, index));
  660. }
  661.  
  662. qboolean trap_G2API_AttachG2Model(void *ghoul2From, int modelFrom, void *ghoul2To, int toBoltIndex, int toModel)
  663. {
  664.     return (qboolean)(syscall(CG_G2_ATTACHG2MODEL, ghoul2From, modelFrom, ghoul2To, toBoltIndex, toModel));
  665. }
  666.  
  667. qboolean    trap_G2API_DetachG2Model(void *ghoul2, int modelIndex)
  668. {
  669.     return (qboolean)(syscall(CG_G2_DETACHG2MODEL, ghoul2, modelIndex));
  670. }
  671.  
  672. qboolean trap_G2_HaveWeGhoul2Models(    void *ghoul2)
  673. {
  674.     return (qboolean)(syscall(CG_G2_HAVEWEGHOULMODELS, ghoul2));
  675. }
  676.  
  677. qboolean trap_G2API_GetBoltMatrix(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
  678.                                 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
  679. {
  680.     return (qboolean)(syscall(CG_G2_GETBOLT, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
  681. }
  682.  
  683. int trap_G2API_InitGhoul2Model(void **ghoul2Ptr, const char *fileName, int modelIndex, qhandle_t customSkin,
  684.                           qhandle_t customShader, int modelFlags, int lodBias)
  685. {
  686.     return syscall(CG_G2_INITGHOUL2MODEL, ghoul2Ptr, fileName, modelIndex, customSkin, customShader, modelFlags, lodBias);
  687. }
  688.  
  689. qboolean trap_G2API_GetAnimFileNameIndex ( TGhoul2 ghoul2, qhandle_t modelIndex, const char* filename )
  690. {
  691.     return syscall(CG_G2_GETANIMFILENAMEINDEX, ghoul2, modelIndex, filename );
  692. }
  693.  
  694. qhandle_t trap_G2API_RegisterSkin ( const char *skinName, int numPairs, const char *skinPairs)
  695. {
  696.     return syscall(CG_G2_REGISTERSKIN, skinName, numPairs, skinPairs );
  697. }
  698.  
  699. qboolean trap_G2API_SetSkin ( TGhoul2 ghoul2, int modelIndex, qhandle_t customSkin)
  700. {
  701.     return syscall(CG_G2_SETSKIN, ghoul2, modelIndex, customSkin );
  702. }
  703.  
  704. void trap_G2API_CleanGhoul2Models(void **ghoul2Ptr)
  705. {
  706.     syscall(CG_G2_CLEANMODELS, ghoul2Ptr);
  707. }
  708.  
  709. qboolean trap_G2API_SetBoneAngles(void *ghoul2, int modelIndex, const char *boneName, const vec3_t angles, const int flags,
  710.                                 const int up, const int right, const int forward, qhandle_t *modelList,
  711.                                 int blendTime , int currentTime )
  712. {
  713.     return (syscall(CG_G2_ANGLEOVERRIDE, ghoul2, modelIndex, boneName, angles, flags, up, right, forward, modelList, blendTime, currentTime));
  714. }
  715.  
  716. qboolean trap_G2API_SetBoneAnim(void *ghoul2, const int modelIndex, const char *boneName, const int startFrame, const int endFrame,
  717.                               const int flags, const float animSpeed, const int currentTime, const float setFrame , const int blendTime )
  718. {
  719.     return syscall(CG_G2_PLAYANIM, ghoul2, modelIndex, boneName, startFrame, endFrame, flags, PASSFLOAT(animSpeed), currentTime, PASSFLOAT(setFrame), blendTime);
  720. }
  721.  
  722. qboolean trap_G2API_GetBoneAnim( void *ghoul2, const int modelIndex, const char *boneName, const int currentTime, float* frame )
  723. {
  724.     return syscall(CG_G2_GETANIM, ghoul2, modelIndex, boneName, currentTime, frame );
  725. }
  726.  
  727. qboolean trap_G2API_SetSurfaceOnOff(void *ghoul2, const int modelIndex, const char *surfaceName, const int flags)
  728. {
  729.     return syscall(CG_G2_SETSURFACEONOFF, ghoul2, modelIndex, surfaceName, flags);
  730. }
  731.  
  732. qboolean trap_G2API_SetRootSurface(void **ghoul2, const int modelIndex, const char *surfaceName)
  733. {
  734.     return syscall(CG_G2_SETROOTSURFACE, ghoul2, modelIndex, surfaceName);
  735. }
  736.  
  737. qboolean trap_G2API_SetNewOrigin(void *ghoul2, const int modelIndex, const int boltIndex)
  738. {
  739.     return syscall(CG_G2_SETNEWORIGIN, ghoul2, modelIndex, boltIndex);
  740. }
  741.  
  742. char *trap_G2API_GetGLAName(void *ghoul2, int modelIndex)
  743. {
  744.     return (char *)syscall(CG_G2_GETGLANAME, ghoul2, modelIndex);
  745. }
  746.  
  747. int trap_G2API_CopyGhoul2Instance(void *g2From, void *g2To, int modelIndex)
  748. {
  749.     return syscall(CG_G2_COPYGHOUL2INSTANCE, g2From, g2To, modelIndex);
  750. }
  751.  
  752. int trap_G2API_CopySpecificGhoul2Model(void *g2From, int modelFrom, void *g2To, int modelTo)
  753. {
  754.     return syscall(CG_G2_COPYSPECIFICGHOUL2MODEL, g2From, modelFrom, g2To, modelTo);
  755. }
  756.  
  757. void trap_G2API_DuplicateGhoul2Instance(void *g2From, void **g2To)
  758. {
  759.     syscall(CG_G2_DUPLICATEGHOUL2INSTANCE, g2From, g2To);
  760. }
  761.  
  762. qboolean trap_G2API_RemoveGhoul2Model(void **ghlInfo, int modelIndex)
  763. {
  764.     return syscall(CG_G2_REMOVEGHOUL2MODEL, ghlInfo, modelIndex);
  765. }
  766.  
  767. void trap_G2API_AddSkinGore(void *ghlInfo,SSkinGoreData *gore)
  768. {
  769.     syscall(CG_G2_ADDSKINGORE, ghlInfo, gore);
  770. }
  771.  
  772. void trap_G2API_ClearSkinGore ( void* ghlInfo )
  773. {
  774.     syscall(CG_G2_CLEARSKINGORE, ghlInfo );
  775. }
  776.  
  777. qboolean trap_G2API_SetGhoul2ModelFlags(void *ghlInfo,int flags)
  778. {
  779.     return(syscall(CG_G2_SETGHOUL2MODELFLAGS,ghlInfo,flags));
  780. }
  781.  
  782. int trap_G2API_GetGhoul2ModelFlags(void *ghlInfo)
  783. {
  784.     return(syscall(CG_G2_GETGHOUL2MODELFLAGS,ghlInfo));
  785. }
  786.  
  787. qboolean trap_G2API_SetGhoul2ModelFlagsByIndex(void *ghoul2,int index,int flags)
  788. {
  789.     return(syscall(CG_G2_SETGHOUL2MODELFLAGSBYINDEX,ghoul2,index,flags));
  790. }
  791.  
  792. int trap_G2API_GetGhoul2ModelFlagsByIndex(void *ghoul2,int index)
  793. {
  794.     return(syscall(CG_G2_GETGHOUL2MODELFLAGSBYINDEX,ghoul2,index));
  795. }
  796.  
  797. int trap_G2API_GetNumModels(TGhoul2 ghoul2)
  798. {
  799.     return syscall(CG_G2_GETNUMMODELS, ghoul2);
  800. }
  801.  
  802. int trap_G2API_FindBoltIndex(TGhoul2 ghoul2, const int modelIndex, const char *boneName)
  803. {
  804.     return syscall(CG_G2_FINDBOLTINDEX, ghoul2, modelIndex, boneName);
  805. }
  806.  
  807. int trap_G2API_GetBoltIndex(TGhoul2 ghoul2, const int modelIndex)
  808. {
  809.     return syscall(CG_G2_GETBOLTINDEX, ghoul2, modelIndex);
  810. }
  811.  
  812. void trap_MAT_Init(void)
  813. {
  814.     syscall(CG_MAT_CACHE);
  815. }
  816.  
  817. void trap_MAT_Reset(void)
  818. {
  819.     syscall(CG_MAT_RESET);
  820. }
  821.  
  822. sfxHandle_t trap_MAT_GetSound(char *key, int material)
  823. {
  824.     return (sfxHandle_t)syscall(CG_MAT_GET_SOUND, key, material);
  825. }
  826.  
  827. qhandle_t trap_MAT_GetDecal(char *key, int material)
  828. {
  829.     return (sfxHandle_t)syscall(CG_MAT_GET_DECAL, key, material);
  830. }
  831.  
  832. const float trap_MAT_GetDecalScale(char *key, int material)
  833. {
  834.     return (const float)syscall(CG_MAT_GET_DECAL_SCALE, key, material);
  835. }
  836.  
  837. qhandle_t trap_MAT_GetEffect(char *key, int material)
  838. {
  839.     return (sfxHandle_t)syscall(CG_MAT_GET_EFFECT, key, material);
  840. }
  841.  
  842. qhandle_t trap_MAT_GetDebris(char *key, int material)
  843. {
  844.     return (sfxHandle_t)syscall(CG_MAT_GET_DEBRIS, key, material);
  845. }
  846.  
  847. const float trap_MAT_GetDebrisScale(char *key, int material)
  848. {
  849.     return (const float)syscall(CG_MAT_GET_DEBRIS_SCALE, key, material);
  850. }
  851.  
  852. // CGenericParser2 (void *) routines
  853. TGenericParser2 trap_GP_Parse(char **dataPtr, qboolean cleanFirst, qboolean writeable)
  854. {
  855.     return (TGenericParser2)syscall(GP_PARSE, dataPtr, cleanFirst, writeable);
  856. }
  857.  
  858. TGenericParser2 trap_GP_ParseFile(char *fileName, qboolean cleanFirst, qboolean writeable)
  859. {
  860.     return (TGenericParser2)syscall(GP_PARSE_FILE, fileName, cleanFirst, writeable);
  861. }
  862.  
  863. void trap_GP_Clean(TGenericParser2 GP2)
  864. {
  865.     syscall(GP_CLEAN, GP2);
  866. }
  867.  
  868. void trap_GP_Delete(TGenericParser2 *GP2)
  869. {
  870.     syscall(GP_DELETE, GP2);
  871. }
  872.  
  873. TGPGroup trap_GP_GetBaseParseGroup(TGenericParser2 GP2)
  874. {
  875.     return (TGPGroup)syscall(GP_GET_BASE_PARSE_GROUP, GP2);
  876. }
  877.  
  878.  
  879. // CGPGroup (void *) routines
  880. qboolean trap_GPG_GetName(TGPGroup GPG, char *Value)
  881. {
  882.     return (qboolean)syscall(GPG_GET_NAME, GPG, Value);
  883. }
  884.  
  885. TGPGroup trap_GPG_GetNext(TGPGroup GPG)
  886. {
  887.     return (TGPGroup)syscall(GPG_GET_NEXT, GPG);
  888. }
  889.  
  890. TGPGroup trap_GPG_GetInOrderNext(TGPGroup GPG)
  891. {
  892.     return (TGPGroup)syscall(GPG_GET_INORDER_NEXT, GPG);
  893. }
  894.  
  895. TGPGroup trap_GPG_GetInOrderPrevious(TGPGroup GPG)
  896. {
  897.     return (TGPGroup)syscall(GPG_GET_INORDER_PREVIOUS, GPG);
  898. }
  899.  
  900. TGPGroup trap_GPG_GetPairs(TGPGroup GPG)
  901. {
  902.     return (TGPGroup)syscall(GPG_GET_PAIRS, GPG);
  903. }
  904.  
  905. TGPGroup trap_GPG_GetInOrderPairs(TGPGroup GPG)
  906. {
  907.     return (TGPGroup)syscall(GPG_GET_INORDER_PAIRS, GPG);
  908. }
  909.  
  910. TGPGroup trap_GPG_GetSubGroups(TGPGroup GPG)
  911. {
  912.     return (TGPGroup)syscall(GPG_GET_SUBGROUPS, GPG);
  913. }
  914.  
  915. TGPGroup trap_GPG_GetInOrderSubGroups(TGPGroup GPG)
  916. {
  917.     return (TGPGroup)syscall(GPG_GET_INORDER_SUBGROUPS, GPG);
  918. }
  919.  
  920. TGPValue trap_GPG_FindSubGroup(TGPGroup GPG, const char *name)
  921. {
  922.     return (TGPValue)syscall(GPG_FIND_SUBGROUP, GPG, name);
  923. }
  924.  
  925. TGPValue trap_GPG_FindPair(TGPGroup GPG, const char *key)
  926. {
  927.     return (TGPValue)syscall(GPG_FIND_PAIR, GPG, key);
  928. }
  929.  
  930. qboolean trap_GPG_FindPairValue(TGPGroup GPG, const char *key, const char *defaultVal, char *Value)
  931. {
  932.     return (qboolean)syscall(GPG_FIND_PAIRVALUE, GPG, key, defaultVal, Value);
  933. }
  934.  
  935.  
  936. // CGPValue (void *) routines
  937. qboolean trap_GPV_GetName(TGPValue GPV, char *Value)
  938. {
  939.     return (qboolean)syscall(GPV_GET_NAME, GPV, Value);
  940. }
  941.  
  942. TGPValue trap_GPV_GetNext(TGPValue GPV)
  943. {
  944.     return (TGPValue)syscall(GPV_GET_NEXT, GPV);
  945. }
  946.  
  947. TGPValue trap_GPV_GetInOrderNext(TGPValue GPV)
  948. {
  949.     return (TGPValue)syscall(GPV_GET_INORDER_NEXT, GPV);
  950. }
  951.  
  952. TGPValue trap_GPV_GetInOrderPrevious(TGPValue GPV)
  953. {
  954.     return (TGPValue)syscall(GPV_GET_INORDER_PREVIOUS, GPV);
  955. }
  956.  
  957. qboolean trap_GPV_IsList(TGPValue GPV)
  958. {
  959.     return (qboolean)syscall(GPV_IS_LIST, GPV);
  960. }
  961.  
  962. qboolean trap_GPV_GetTopValue(TGPValue GPV, char *Value)
  963. {
  964.     return (qboolean)syscall(GPV_GET_TOP_VALUE, GPV, Value);
  965. }
  966.  
  967. TGPValue trap_GPV_GetList(TGPValue GPV)
  968. {
  969.     return (TGPValue)syscall(GPV_GET_LIST, GPV);
  970. }
  971.  
  972. void trap_CM_TM_Create(int terrainID)
  973. {
  974.     syscall(CG_CM_TM_CREATE, terrainID);
  975. }
  976.  
  977. void trap_CM_TM_AddBuilding(int x, int y, int side)
  978. {
  979.     syscall(CG_CM_TM_ADDBUILDING, x, y, side);
  980. }
  981.  
  982. void trap_CM_TM_AddSpot(int x, int y)
  983. {
  984.     syscall(CG_CM_TM_ADDSPOT, x, y);
  985. }
  986.  
  987. void trap_CM_TM_AddTarget(int x, int y, float radius)
  988. {
  989.     syscall(CG_CM_TM_ADDTARGET, x, y, PASSFLOAT(radius));
  990. }
  991.  
  992. void trap_CM_TM_Upload(const vec3_t origin, const vec3_t angle)
  993. {
  994.     syscall(CG_CM_TM_UPLOAD, origin, angle);
  995. }
  996.  
  997. void trap_CM_TM_ConvertPosition(void)
  998. {
  999.     syscall(CG_CM_TM_CONVERT_POS);
  1000. }
  1001.  
  1002. int    trap_CM_RegisterTerrain(const char *config)
  1003. {
  1004.     return syscall(CG_CM_REGISTER_TERRAIN, config);
  1005. }
  1006.  
  1007. void trap_RE_InitRendererTerrain( const char *info )
  1008. {
  1009.     syscall(CG_RE_INIT_RENDERER_TERRAIN, info);
  1010. }
  1011.  
  1012. void trap_CG_RegisterSharedMemory(char *memory)
  1013. {
  1014.     syscall(CG_SET_SHARED_BUFFER, memory);
  1015. }
  1016.  
  1017. int trap_FS_GetFileList(  const char *path, const char *extension, char *listbuf, int bufsize ) 
  1018. {
  1019.     return syscall( CG_FS_GETFILELIST, path, extension, listbuf, bufsize );
  1020. }
  1021.  
  1022. void *trap_VM_LocalAlloc ( int size )
  1023. {
  1024.     return (void *)syscall ( CG_VM_LOCALALLOC, size );
  1025. }
  1026.  
  1027. void *trap_VM_LocalAllocUnaligned ( int size )
  1028. {
  1029.     return (void *)syscall ( CG_VM_LOCALALLOCUNALIGNED, size );
  1030. }
  1031.  
  1032. void *trap_VM_LocalTempAlloc( int size )
  1033. {
  1034.     return (void *)syscall ( CG_VM_LOCALTEMPALLOC, size );
  1035. }
  1036.  
  1037. void trap_VM_LocalTempFree( int size )
  1038. {
  1039.     syscall ( CG_VM_LOCALTEMPFREE, size );
  1040. }
  1041.  
  1042. const char *trap_VM_LocalStringAlloc ( const char *source )
  1043. {
  1044.     return (const char *)syscall ( CG_VM_LOCALSTRINGALLOC, source );
  1045. }
  1046.  
  1047. void trap_UI_CloseAll ( void )
  1048. {
  1049.     syscall ( CG_UI_CLOSEALL );
  1050. }
  1051.     
  1052. void trap_UI_SetActiveMenu ( int menu )
  1053. {
  1054.     syscall ( CG_UI_SETACTIVEMENU, menu );
  1055. }
  1056.  
  1057.